
<header>

    <meta http-equiv="refresh" content="5">

</header>

{% extends 'home/home.html' %}
{% block index %}
{% load static %}
<div class="uk-section uk-margin-medium-top uk-container uk-margin-top-large" style="padding: 10px;">
    <div class="uk-margin-medium uk-grid" uk-grid="">
        <div class="uk-width-1-1 uk-width-1-1@s">
            <article class="uk-article" style="padding-bottom: 4em;">
                <h2 class="uk-article-title uk-text-center" style="color: #28a">
                    <strong>
                        faq-platform-spider列表
                    </strong>
                </h2>
                <table class="uk-table uk-table-striped uk-table-hover uk-table-small">
                    <thead>
                        <tr class="uk-text-lead " style="font-weight:bold;">
                            <th style="font-size: 1em;font-weight:bold; width: 200px;">爬虫序号</th>
                            <th style="font-size:  1em;font-weight:bold;word-break: keep-all;">爬虫名称</th>
                            <th class="uk-text-right" style="font-size: 1em;font-weight:bold; width: 200px;">
                                更新日期</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% if spiders %}
                        {% for spider in spiders %}
                        <tr>
                            <td style="font-weight:bold;">{{ spider.id }}</td>
                            <td class="uk-text-left" style="font-size: 16px;">{{ spider.name }}</td>
                            <td class="uk-text-right" style="font-size: 16px;">{{ spider.update_time }}</td>
                            <td class="uk-text-right" >

                                {% if spider.status == "finish"%}
                                <a href="/spiders/run/{{ spider.id }}?next={{ request.GET.next }}">
                                    <dt class="uk-text-normal uk-text-primary"
                                        style="font-size: 16px;font-weight: bold;">
                                        启动爬虫
                                    </dt>
                                </a>
                                {% else %}
                                <img src="https://img.zcool.cn/community/01f0075aa1dfb6a80121246debcafe.gif" style="max-width: 2em;">运行中
                                {% endif %}
                            </td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
                {% else %}
                <p>这里空无一人。</p>
                {% endif %}
            </article>

        </div>

    </div>

</div>
{% endblock %}